import random
print("""
*******************************
        欢迎来到猜数字游戏
          我是北辰.天狼
       开发时间：2025.3.12
*******************************
""")

times = 0
luckynum = random.randint(1,100)
guess = int(input("请输入你猜的数字："))

while True:
    if guess == luckynum:
        print("恭喜你猜对了")
        print("你一共用了",times,"次")
        break
    else:
        print("猜错了")
        if guess>luckynum:
            guess = int(input("大了，请重新输入："))
            times += 1
        else:
            guess = int(input("小了，请重新输入："))
            times += 1